import numpy as np
def point_to_line_projection(point, line_start, line_end):
    """
    计算点到直线的投影点
    
    参数:
        point: 待投影的点，形状为(2,)的NumPy数组或列表 [x, y]
        line_start: 直线起点，形状为(2,)的NumPy数组或列表 [x1, y1]
        line_end: 直线终点，形状为(2,)的NumPy数组或列表 [x2, y2]
    
    返回:
        投影点坐标 [x, y]
    """
    # 转换为NumPy数组
    point = np.array(point)
    line_start = np.array(line_start)
    line_end = np.array(line_end)
    
    # 计算向量AB和AP
    AB = line_end - line_start
    AP = point - line_start
    
    # 计算投影比例t
    t = np.dot(AP, AB) / np.dot(AB, AB)
    t = np.clip(t, 0, 1)
    
    print(f'投影比例{t}')
    # 计算投影点
    projection = line_start + t * AB
    
    return projection